{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c74aa882",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_PM_gz['job.title']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d597b367",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-1-ddab55581af9>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-1-ddab55581af9>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    df_PM_gz['job.title'][df_PM_gz['job.title'].str.contains('（')].str.split('（').apply(lambada x:x[0])\u001b[0m\n\u001b[1;37m                                                                                                ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "df_PM_gz['job.title'][df_PM_gz['job.title'].str.contains('（')].str.split('（').apply(lambda x:x[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f7793aa1",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_Pm_gz['job.title'].value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7a0ee7f4",
   "metadata": {},
   "source": [
    "##拆分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3e9bb880",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 处理了一些，清洗后的数据\n",
    "df_PM_gz['job.title'].apply(lambda x:x.split('（/')[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a23c161",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b086cdb6",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a43e9d00",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df_PM_gz' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-2-2c70535951c2>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m## 未处理的字符串数据\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mdf_PM_gz\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'job.title'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalue_counts\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'df_PM_gz' is not defined"
     ]
    }
   ],
   "source": [
    "## 未处理的字符串数据\n",
    "df_PM_gz['job.title'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "baf6dc2a",
   "metadata": {},
   "outputs": [],
   "source": [
    "#列表推导式\n",
    "         [(i,j) for i in df_job_yiyle.index]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
